package competition.cig.cs478.features;

import ch.idsia.mario.engine.LevelScene;
import ch.idsia.mario.environments.Environment;

/**
 * NullEnvironment so that the FeatureParser doesn't freak out when the current
 * or previous environments have not yet been loaded.
 * 
 * @author Ian
 * 
 */
public class NullEnvironment implements Environment {

	private byte[][] defaultScene;

	public NullEnvironment() {
		defaultScene = new byte[Environment.HalfObsWidth * 2][Environment.HalfObsHeight * 2];
		for (int i = 0; i < Environment.HalfObsWidth * 2; i++) {
			for (int j = 0; j < Environment.HalfObsHeight * 2; j++) {
				defaultScene[i][j] = 0;
			}
		}
	}

	@Override
	public String getBitmapEnemiesObservation() {
		return "";
	}

	@Override
	public String getBitmapLevelObservation() {
		return "";
	}

	@Override
	public byte[][] getCompleteObservation() {
		return defaultScene;
	}

	@Override
	public float[] getEnemiesFloatPos() {
		return new float[0];
	}

	@Override
	public byte[][] getEnemiesObservation() {
		return defaultScene;
	}

	@Override
	public byte[][] getEnemiesObservationZ(int ZLevelEnemies) {
		return defaultScene;
	}

	@Override
	public int getKillsByFire() {
		return 0;
	}

	@Override
	public int getKillsByShell() {
		return 0;
	}

	@Override
	public int getKillsByStomp() {
		return 0;
	}

	@Override
	public int getKillsTotal() {
		return 0;
	}

	@Override
	public byte[][] getLevelSceneObservation() {
		return defaultScene;
	}

	@Override
	public byte[][] getLevelSceneObservationZ(int ZLevelScene) {
		return defaultScene;
	}

	@Override
	public float[] getMarioFloatPos() {
		return new float[] { 0.0f, 0.0f };
	}

	@Override
	public int getMarioMode() {
		return 0;
	}

	@Override
	public byte[][] getMergedObservationZ(int ZLevelScene, int ZLevelEnemies) {
		return defaultScene;
	}

	@Override
	public boolean isMarioCarrying() {
		return false;
	}

	@Override
	public boolean isMarioOnGround() {
		return true;
	}

	@Override
	public boolean mayMarioJump() {
		return true;
	}

	@Override
	public double getLevelLength() {
		return 0;
	}

}
